<?php
/**
 * Created by PhpStorm.
 * User: linux
 * Date: 12/01/2018
 * Time: 2:12 PM
 */

namespace Criteria\Criteria;


class OrCriteria implements Criteria
{
    private $criteria;
    private $criteria2;

    public function __construct(Criteria $criteria, Criteria $criteria2)
    {
        $this->criteria = $criteria;
        $this->criteria2 = $criteria2;
    }

    /** 两个过滤条件 或
     * @param array $persons
     * @return mixed
     */
    function meetCriteria(array $persons) : array
    {
        return array_merge($this->criteria->meetCriteria($persons), $this->criteria2->meetCriteria($persons));
    }

}